home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / Simple Child Object.dir / 00003_Ball Parent Script.ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  522 b   |  21 lines

  1. property horizPos
  2.  
  3. on new me
  4.   set the horizPos of me to 200
  5.   set the locH of sprite 2 to the horizPos of me
  6.   set the locV of sprite 2 to 120
  7.   return me
  8. end
  9.  
  10. on moveBall me, direction
  11.   set the horizPos of me to (direction * 50) + the horizPos of me
  12.   set stageWidth to the stageRight - the stageLeft
  13.   if the horizPos of me > (stageWidth + 99) then
  14.     set the horizPos of me to 0
  15.   end if
  16.   if the horizPos of me < -99 then
  17.     set the horizPos of me to stageWidth
  18.   end if
  19.   set the locH of sprite 2 to horizPos
  20. end
  21.